package com.chenjim.architecture.screen.home

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.safeDrawingPadding
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.navigation.NavHostController
import com.chenjim.architecture.screen.Screen
import com.chenjim.architecture.screen.home.HomeScreenVM.UiIntent

@Composable
fun HomeScreen(
    navController: NavHostController,
    viewModel: HomeScreenVM = hiltViewModel(),
) {
    viewModel.processIntent(UiIntent.InitIntent)

    val viewState = viewModel.uiState.collectAsState().value
    Column(modifier = Modifier.safeDrawingPadding()) {
        Text(
            text = "HomeScreen", fontSize = 24.sp, modifier = Modifier.padding(20.dp)
        )

        Text(

            text = "HistoryOrderScreen",
            fontSize = 24.sp,
            modifier = Modifier
                .padding(20.dp)
                .clickable {
                    navController.navigate(Screen.HistoryOrder.route)
                },
        )
        Text(
            text = "OnlineRechargeScreen",
            fontSize = 24.sp,
            modifier = Modifier
                .padding(20.dp)
                .clickable {
                    navController.navigate(Screen.Recharge.route)
                },
        )
        Text(
            text = "ShimmerScreen",
            fontSize = 24.sp,
            modifier = Modifier
                .padding(20.dp)
                .clickable {
                    navController.navigate(Screen.Shimmer.route)
                },
        )
    }
}

